﻿using GDI_应用案例.Pages._3D图像;
using GDI_应用案例.Pages.Controls;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace GDI_应用案例.Pages
{
    [FormPage(10, "3D图像")]
    public partial class Page3D图像 : PageBase
    {
        public Page3D图像()
        {
            InitializeComponent();

            hologramControl1.FaceSize = new Point3D(80, 80, 80);

            string rootPath=Path.Combine(Application.StartupPath, "Images", "Hologram");

            // 背景
            string[] dirPath = Directory.GetDirectories(Path.Combine(rootPath, "back"));
            string[] files = Directory.GetFiles(dirPath[0]);
            Array.Sort(files);
            hologramControl1.LoadBackImages(files);
           
            // 面
             dirPath =Directory.GetDirectories(Path.Combine(rootPath,"face"));
            if (dirPath.Length != 6)
                throw new ArgumentException("文件夹不对");

            string[][] filePaths=new string[dirPath.Length][];
            for (int i = 0; i < dirPath.Length; i++)
            {
                files = Directory.GetFiles(dirPath[i]);
                Array.Sort(files);
                filePaths[i]= files;
            }
            hologramControl1.LoadImage(filePaths);
        }
    }
}
